import type { Page } from "@/types/common"
import type { AddEnterpriseParams, EnterpriseDetail, EnterpriseList, GetEnterpriseListParams, industryList, MyBuilding, POSTParkEnterpriseRentParams, Rents, UpdateEnterprise } from "@/types/park"
import { request } from "@/utils/reuqest"
export const getEnterpriseListAPI=(data:GetEnterpriseListParams)=>{
  return request<EnterpriseList>('/park/enterprise','GET',data)
}
export const addEnterpriseAPI=(data:AddEnterpriseParams)=>{
  return request('/park/enterprise','POST',data)
}
export const getIndustryListAPI=()=>{
  return request<industryList[]>('park/industry','GET')
}
export const getEnterpriseDetailAPI=(id:string)=>{
 return request<EnterpriseDetail>(`park/enterprise/${id}`,'GET')
}
export const updateEnterpriseAPI=(data:UpdateEnterprise)=>{
  return request('park/enterprise','PUT',data)
}
export const delEnterpriseAPI=(id:string)=>{
  return request(`park/enterprise/${id}`,'DELETE')
}
export const getMyBuildingAPI=()=>{
  return request<MyBuilding[]>('park/rent/building')
}
//添加合同
export const addEnterpriseRentAPI=(data:POSTParkEnterpriseRentParams)=>{
 return request('park/enterprise/rent','POST',data)
}
//展开的合同列表
export const getEnterpriseRentAPI=(id:number)=>{
  return request<Rents[]>(`park/enterprise/rent/${id}`)
}